Contoh program Visual_Basic

 Option Explicit
Public TestBool as Boolean
Sub Main ()
TestBool = TestCall ( 5 , True )
End Sub
Function TestCall ( X as Integer, Y as Boolean ) as Boolean
On Error GoTo SolveError
' Ini ialah komen
Dim Z as Integer
Select Case X
Case 0
If Y Then TestCall = True
Case 8
If Y Then TestCall = True
Exit Function
End Select
Z = (X * 3 / 2 + 8 - 9)^2
Do Until Z < 2
Z = Z - 1
Loop
SolveError:
MsgBox Err.Num & " " & Err.Description, , "TestCall"
End Function